var cache = require('../system/cache')

var commonCachePrefix = 'business_storage_flag_'

var businessStorage = {
    save: function (key, obj) {
        var valStr = JSON.stringify(obj)
        cache.set(commonCachePrefix + key, valStr)
    },
    get: function (key) {
        var wholeValStr = cache.get(commonCachePrefix + key)
        var finalVal = JSON.parse(wholeValStr)
        return finalVal
    }
}

module.exports = businessStorage